package cn.itsource.aigou.client;


import cn.itsource.aigou.util.AjaxResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

                                        //fallback 也可以
@FeignClient(value = "common-service",fallbackFactory = RedisFallBackFactory.class)
public interface RedisClient {

    /**
     * 存值存入缓存
     * @param key
     * @param value
     * @return
     */
    @PostMapping("/redis")
    public AjaxResult set(@RequestParam("key") String key,@RequestParam("value") String value);


    /**
     * 取值 从缓存中取值
     * @param key
     * @return
     */
    @GetMapping("/redis")
    public AjaxResult get(@RequestParam("key") String key);

}
